﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BawangMemo.BawangMemoView.View
{
    /// <summary>
    /// RateView.xaml 的交互逻辑
    /// </summary>
    public partial class RateView : UserControl
    {

        int _rate;
        double _scale;

        public int Rate
        {
            set
            {
                if (value >= 0 && value <= 50){
                    _rate = value;
                    image2.Width = _scale * 0.7 * _rate;
                    label1.Content = _rate / 10.0;
                }
            }
            get
            {
                return _rate;
            }
        }

        public double Scale
        {
            set
            {
                _scale = value;
                this.Width = _scale * 45;
                this.Height = _scale * 7;
                label1.FontSize = _scale * 5;
            }
            get
            {
                return _scale;
            }
        }

        public RateView()
        {
            InitializeComponent();
        }
    }
}
